<template>
  <div>
    <a-card :bordered="false">
      <a-row>
        <a-col :span="24" style="margin-top: 15px">
          连续签到几天送优惠券:
          <a-input-number :min="0" style="width: 200px" property="连续签到几天送优惠券" v-model="signDays"></a-input-number>
        </a-col>
      </a-row>
    </a-card>
    <footer-tool-bar>
      <a-button type="primary" @click="sureEdit" :loading="loading">保存修改</a-button>
    </footer-tool-bar>
  </div>
</template>

<script>
import FooterToolBar from '@/components/tools/FooterToolBar'
import STable from '@/components/table/'
import DetailList from '@/components/tools/DetailList'

import JInput from "@/components/jeecg/JInput"
import JImageUpload from '@/components/jeecg/JImageUpload'
import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
import { postAction, getAction } from '@/api/manage'

const DetailListItem = DetailList.Item

export default {
  components: {
    JInput,
    FooterToolBar,
    DetailList,
    DetailListItem,
    STable,
    JImageUpload,
    JDictSelectTag
  },
  data () {
    return {
      loading: false,
      a: '',
      signDays: 1,
      url: {
        edit: "cmsConfig/setSignDaysConfig",
        list: "cmsConfig/querySignDaysConfig"
      },
      visable: false,
      visable2: false,
      imgSrc: "",
      index: '',
    }
  },
  methods: {

    sureEdit () {
      console.log(this.UmsIntegralConfig)
      this.loading = true
      getAction(this.url.edit, { signDays: this.signDays }).then((res) => {
        if (res.success) {
          console.log("修改成功")
          this.$message.info('修改成功')
        }
        if (res.code === 510) {
          this.$message.warning(res.message)

        }
        this.loading = false
      })
    },
    getOfflinePayConfig () {
      getAction(this.url.list, {}).then((res) => {
        if (res.success) {
          this.signDays = res.result
        }
        if (res.code === 510) {
          this.$message.warning(res.message)
        }
        this.loading = false
      })
    },
  },
  created () {
    this.getOfflinePayConfig()
  },

  computed: {
    title () {
      return this.$route.meta.title
    }
  },

}
</script>

<style lang="less" scoped>
.title {
  color: rgba(0, 0, 0, 0.85);
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 16px;
}

h1,
h2 {
  font-weight: normal;
}

ul {
  list-style-type: none;
  padding: 0;
}

li {
  display: inline-block;
  margin: 0 10px;
}

a {
  color: #42b983;
}

tr,
th {
  text-align: center;
  width: 130px;
}
</style>